package com.wuercloud.mq.message.consumer;

import com.wuercloud.mq.common.ResultRes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Created by JiangWL on 2017/3/30.
 */
@Component
public class SmsYfkjObserverTest implements ConsumerObserver {
    private static final String BIZ_QUEUE = "SMS-DOOR-YFKJ";
    @Autowired
    private ConsumerSubject consumerSubject;
    @Override
    public String getBizQueue() {
        return BIZ_QUEUE;
    }

    @PostConstruct
    void init(){
        consumerSubject.attach(this);
    }

    @Override
    public ResultRes consume(String bizQueue, String message) {
        System.out.println("待处理内容为： "+message);
        //真实业务类实现接品consume方法时进行业务处理
        return new ResultRes(true,"业务处理成功");
    }
}
